﻿using Basic.FlowModel.DB;
using Basic.FlowModel.Flow;
using Basic.FlowModel.Node;
using Basic.FlowRemoteModel;
using Basic.FlowRemoteModel.Flow.Model;
using WeDonekRpc.Model;

namespace Basic.FlowCollect
{
    public interface IFlowCollect
    {
        long? GetDefFormId ( long flowId );
        Result[] GetChildren<Result> ( long sourceId ) where Result : class, new();

        Result[] GetChildren<Result> ( long[] sourceId ) where Result : class, new();
        long Add ( FlowAdd add );

        long Save ( FlowBodyAdd add );
        void Delete ( DBFlowList source );
        DBFlowList Get ( long id );
        Result[] Query<Result> ( FlowQueryParam query, IBasicPage paging, out int count ) where Result : class;
        bool Set ( DBFlowList source, FlowSet set );
        Result Get<Result> ( long id ) where Result : class, new();
        Dictionary<long, string> GetFlowName ( long[] ids );

        string GetFlowName ( long id );
        bool SetStatus ( DBFlowList flow, FlowStatus status );
        bool Enable ( DBFlowList flow, NodeSet[] nodeSets );
        bool CheckIsExists ( string name, string ver );
        string GetMaxVer ( long id );
        long GetFlowId ( long sourceId, string ver );
    }
}